<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="renderer" content="webkit">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>信审员遗留问题</title>
	<jsp:include page="../../import.jsp" flush="true" />
</head>
<body>
<div class="Wrapper">
	<form id="aud_remain_pro_form">
		<div class="fieldset1 tabel_col tabel_col_s clearFix noBorder">
			<div class="sqPanel col_100" >
				<div class="sqPanel_head inL">
					<span>信审员遗留问题</span>
				</div>
				<div  style="width:100%" >
					<textarea name="audRemain" id="audRemain" rows="6" class="l-textarea" validate="{required:true, maxlength:250}" style="width:87%; margin-left: 50px"></textarea>
				</div>
			</div>
		</div>

		<div class="btnsBox">
			<span id="cr_bsc_info_add_btn_id" class="sq-button sq-button-round" onclick="save();">保存</span>
			<span id="cr_bsc_info_close_btn_id" class="sq-button sq-button-round" onclick="closeWind();">关闭</span>
		</div>
	</form>
</div>
<script>
	$(function() {
		$("#aud_remain_pro_form").ligerForm({
			validate: true
		});
		initData();
	});

	//新增回调
	function closeWind(){
		parent.$(".l-dialog,.l-window-mask").css("display","none");
		parent.grid.reload();
	}
	function save(){
		$.ligerDialog.confirm("确定要保存至信审员遗留问题吗？", function (flag) {
			if(flag == false)return;
			var ligerForm = liger.get("aud_remain_pro_form");
			if (!ligerForm.valid()) {
				top.$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO,SQ_type: "warning"});
				return false;
			}
			var data = ligerForm.getData();
			data["id"] = "${id}";

			var url = '<%=path%>/audit/audStandingBook/addAudRemainPro.do';
			var wait_dialog;
			$.ajax({
				type: 'post',
				dataType:'json',
				data:data,
				url: url,
				beforeSend: function(){
					wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
				},
				success:function(msg){
					wait_dialog.close();
					if(msg.success == 1){
						top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "success"});
						parent.$(".l-dialog,.l-window-mask").css("display","none");
						parent.grid.reload();
					}else{
						wait_dialog.close();
						top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
					}
				}
			});

		});
	}

	function initData(){
		var id = '${id}';
		if(!id)return;
		var wait_dialog;
		var _url = '<%=path%>/audit/audStandingBook/selectById.do';
		$.ajax({
			type: 'get',
			dataType:'json',
			data:{id:id},
			url: _url,
			beforeSend: function(){
				wait_dialog=$.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING ,SQ_type: "waitting" });
			},
			success:function(msg){
				wait_dialog.close();
				if(msg.success == 1){
					console.log(msg.data);
					setData(msg.data);//设置数据
				}else{
					top.$.ligerDialog.SQalert({content: msg.info,SQ_type: "error"});
				}
			}
		});
	}

	//设置页面数据
	function setData(data){
		var form = liger.get("aud_remain_pro_form");
		form.setData({
			audRemain:data.audRemainPro,
		});
	};
</script>

</body>
</html>